<?php

namespace admin\controllers;

use admin\components\AdminController;
use app\models\User;

class MemberController extends AdminController {

    public $name = '大学生管理';

    public function actionIndex() {
        $searchModel = NULL;
        $query = User::find()->where(['type' => User::TYPE_STUDENT])->with(['profile']);

        $dataProvider = $this->search($query, new User());
        return $this->render(compact('searchModel', 'dataProvider'));
    }

    public function actionView($id) {
        $model = $this->findModel($id, User::className());
        return $this->render(compact('model'));
    }
}
